#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#define N 10

void Inin(int(* arr)[N], int n)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <=i; j++)
		{
			if(j==0||i==j)
			{
				arr[i][j] = 1;
			}
		}
	}
	for (int i = 2; i < n; i++)
	{
		for (int j = 1; j <=i; j++)
		{
			arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
		}
	}
	
}

void Print(int(* arr)[N], int n)
{

	int i = 0;
	for (i = 0; i < n; i++)
	{
		int j = 0;
		for (j = 0; j < i; j++)
		{
			printf("%4d", arr[i][j]);
		}
		printf("\n");
	}
}

int main()
{
	int arr[N][N] = { 0 };
	Inin(arr, N);
	Print(arr, N);
	/*for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (j == 0 || i == j)
			{
				arr[i][j] = 1;
			}
		}
	}
	for (int i = 2; i < N; i++)
	{
		for (int j = 1; j <=i; j++)
		{
			arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
		}
	}

	int i = 0;
	for (i = 0; i < N; i++)
	{
		int j = 0;
		for (j = 0; j <=i; j++)
		{
			printf("%5d", arr[i][j]);
		}
		printf("\n");
	}*/
	return 0;
}